-
Notifications
You must be signed in to change notification settings - Fork 89
feat(storage): add dump storage table to file utility #1239
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1239 +/- ##
==========================================
- Coverage 71.84% 71.78% -0.07%
==========================================
Files 80 81 +1
Lines 7810 7842 +32
Branches 7810 7842 +32
==========================================
+ Hits 5611 5629 +18
- Misses 1300 1307 +7
- Partials 899 906 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Yael-Starkware)
crates/papyrus_storage/src/utils.rs
line 13 at r1 (raw file):
use crate::{open_storage, StorageConfig, StorageResult, StorageTxn}; /// dumps a table from the storage to a file in JSON format
Fix grammar - Capitalize first word, put "." at end of sentence. (x2)
crates/papyrus_storage/src/utils.rs
line 26 at r1 (raw file):
let mut cursor = table_handle.cursor(&txn.txn)?; let iter = DbIter::new(&mut cursor); let file = File::create(file_path)?;
what happens if the file already exists?
what happens if the directory doesn't exist?
do we want to handle / document faulty scenarios?
crates/papyrus_storage/src/utils.rs
line 41 at r1 (raw file):
} /// dumps the declared classes table from the storage to a file
declared_classes
Code quote:
declared classes
d600d56
to
b9b358d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @OmriEshhar1)
crates/papyrus_storage/src/utils.rs
line 13 at r1 (raw file):
Previously, OmriEshhar1 wrote…
Fix grammar - Capitalize first word, put "." at end of sentence. (x2)
Done.
crates/papyrus_storage/src/utils.rs
line 26 at r1 (raw file):
Previously, OmriEshhar1 wrote…
what happens if the file already exists?
what happens if the directory doesn't exist?
do we want to handle / document faulty scenarios?
if the file exists then it's content will be reset.
id a directory doesn't exist, the error will be passed with the ? operator.
any faulty scenario is returned from the function. I will make sure to print the error clearly in the main function.
crates/papyrus_storage/src/utils.rs
line 41 at r1 (raw file):
Previously, OmriEshhar1 wrote…
declared_classes
Done.
b9b358d
to
7f2ccc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information
This change is